<div class="container">
    <div id="role_tb">
        <a href="#" onclick="add()" class="easyui-linkbutton" data-options="iconCls:'fa fa-plus'">添加</a>
        <a href="#" onclick="edit()" class="easyui-linkbutton" data-options="iconCls:'fa fa-pencil'">编辑</a>
        <a href="#" onclick="del()" class="easyui-linkbutton" data-options="iconCls:'fa fa-remove'">删除</a>
    </div>
    <div class="_datagrid">
        <table id="role_dg"></table>
    </div>
</div>
<script>
    var user_dg;
    $(function () {
        user_dg = $('#role_dg').datagrid({
            url: "#(ctx)/admin/roleMenu/roleList",
            fitColumns: true,
            pagination: true,
            rownumbers: true,
            singleSelect:true,
            pageSize: 10,
            pageList: [10, 20, 30],
            idField: 'roleId',
            columns: [
                [{
                    field: 'roleId',
                    width: 100,
                    hidden: true,
                    title: 'id'
                }, {
                    field: 'roleName',
                    title: '角色名称',
                    width: 100
                }, {
                    field: 'roleDesc',
                    title: '角色描述',
                    width: 150
                }, {
                    field: 'createTime',
                    title: 'createTime',
                    width: 100
                },{
                    field:'操作',
                    title:'操作',
                    width:120,
                    formatter: function(value,row,index){
                        return '<a href="">分配权限</a>'
                    }
                }]
            ],
            toolbar: '#role_tb'
        });
    })
</script>